home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / dev / misc / LEDA_gene.lha / LEDA-3.1c-generic / incl / LEDA / impl / rs_tree.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-05  |  1.3 KB  |  63 lines

  1. /*******************************************************************************
  2. +
  3. +  LEDA  3.1c
  4. +
  5. +
  6. +  rs_tree.h
  7. +
  8. +
  9. +  Copyright (c) 1994  by  Max-Planck-Institut fuer Informatik
  10. +  Im Stadtwald, 6600 Saarbruecken, FRG     
  11. +  All rights reserved.
  12. *******************************************************************************/
  13.  
  14.  
  15. #ifndef LEDA_RS_TREE_H
  16. #define LEDA_RS_TREE_H
  17.  
  18. //------------------------------------------------------------------------------
  19. //
  20. // rs_tree:  
  21. //
  22. //           derived from class "bin_tree"
  23. //
  24. // Ijon Tichy (1993)
  25. //
  26. //------------------------------------------------------------------------------
  27.  
  28.  
  29. #include <LEDA/basic.h>
  30. #include <LEDA/impl/bin_tree.h>
  31.  
  32.  
  33. typedef bin_tree_node* rs_tree_item;
  34.  
  35.  
  36. // ----------------------------------------------------------------
  37. // class rs_tree
  38. // ----------------------------------------------------------------
  39.  
  40. class rs_tree : public virtual bin_tree
  41.   int root_balance() { return random(); }
  42.   int node_balance() { return random(); }
  43.   int leaf_balance() { return 0; }
  44.  
  45.   void insert_rebal(rs_tree_item);
  46.   void del_rebal(rs_tree_item, rs_tree_item);
  47.  
  48.  
  49. public:
  50.  
  51.  rs_tree() {}
  52. ~rs_tree() {}
  53.  rs_tree(const rs_tree& T) : bin_tree(T) {}
  54.  rs_tree& operator=(const rs_tree& T) { bin_tree::operator=(T); return *this; }
  55.  
  56. };
  57.  
  58. #endif
  59.  
  60.  
  61.